Open
Conversation
Contributor
Please add: |
Contributor
|
oh it is: |
Contributor
|
are properties supported ? |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Thanks for your effort and interest 💛 in improving the project. It's very appreciated.
Description
What's New in v2.1.0-alpha - Frame Support & Event Isolation
🔗 Linked GitHub Issues
Closes #<number>
📋 What is the current behavior?
🚀 What is the new behavior?
Type of changes
Breaking changes 🔥
How and where was this tested?
🖥️ Describe where you tested your changes
System:
Context:
NetJson.ParserNetWebView2.Manager - WebView2NetWebView2.Manager - Bridge🔬 Describe how you tested your changes
Checklist
Additional context
Screenshots
Note to reviewers
This patch introduces first-class support for
iframeinteraction, allowing developers to target specific frames for script execution, messaging, and host object binding.Key Features & Enhancements
1. Professional Frame Support (WebView2Frame)
IFrames are no longer just metadata. You can now obtain a dedicated COM object for any frame to interact with it directly.
GetFrame(index): returns anIWebView2Frameobject.ExecuteScript,ExecuteScriptWithResult(Thread-Safe Sync),PostWebMessageAsJson,PostWebMessageAsString.AddHostObjectToScriptandRemoveHostObjectFromScriptare now supported per frame.2. Isolated Frame Events
Listen to the lifecycle of specific frames without context ambiguity.
OnFrameNavigationStarting,OnFrameNavigationCompleted,OnFrameContentLoading,OnFrameDOMContentLoaded,OnFrameWebMessageReceived.frameNameto facilitate multi-frame coordination.3. Backward Compatibility Sync
The existing bulk extraction methods (
GetFrameCount,GetFrameUrls, etc.) remain fully functional and synchronized with the internal frame tracker.4. Refactoring & Structural Inheritance
The project's internal architecture has been fully reorganized to ensure long-term scalability and clean COM interoperability.
Logic-Based Namespacing: Files are now categorized into dedicated directories (
/Core,/Events,/Interfaces,/Utils). This makes the codebase easier to navigate and ensures that the root namespace remains focused on the primary API.Partial Class Implementation: The
WebView2Manageris now distributed across specialized partial classes (e.g.,Main,Events,FrameMgmt). This maintains a single, unified COM object for the user while keeping the source code modular and readable.Inheritance-Driven Event Wrappers: We introduced
BaseWebViewEventArgs, a parent class for all event wrappers. This leverages C# inheritance to streamline how data is passed to the host application.Why this matters:
Standardized Metadata: Every event now automatically inherits common properties like
WindowHandleand a reference to theManagerinstance.DRY (Don't Repeat Yourself): By using
: base(manager, hwnd), we eliminated boilerplate code. Updates to core event logic (like handle formatting) now only need to be made in one place to affect all event types.Developer Predictability: Whether you are handling a
ZoomChangedor aNavigationStartingevent, the core properties remain consistent, making the library much more intuitive for AutoIt/COM scripting.The project has been reorganized into logical directories: